package com.awonsome.mall.pms.boot.common.enums;

import lombok.Getter;

/**
 * @author yangdejun
 * @date 2022/1/30 22:58
 */
public enum AttributeTypeEnum {

    SPECIFICATION(1, "规格"),
    ATTRIBUTE(2, "属性"),
    ;

    @Getter
    private Integer value;

    @Getter
    private String name;

    AttributeTypeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public static AttributeTypeEnum getByValue(Integer value) {
        AttributeTypeEnum attributeTypeEnum = null;
        for (AttributeTypeEnum item : values()) {
            if (item.getValue().equals(value)) {
                attributeTypeEnum = item;
            }
        }
        return attributeTypeEnum;
    }
}
